package com.lenovo.service.impl;

import com.lenovo.dao.EmpDao;
import com.lenovo.dao.impl.EmpDaoImpl;
import com.lenovo.pojo.Emp;
import com.lenovo.pojo.Result;
import com.lenovo.service.EmpService;

import java.sql.SQLException;

public class EmpServiceImpl implements EmpService {
    EmpDao dao = new EmpDaoImpl();
    @Override
    public Result login(String account, String password) throws SQLException {
        Result result= null;
            if (account == null || "".equals(account) || password ==null || "".equals(password)){
                //return
                result = new Result(401, "用户名或密码不能为空");
                //return  result;
            }else{
                result = dao.login(account, password);
        }
        return result;
    }


    @Override
    public Result showMenuByEmp(int roleid) throws SQLException {
        return dao.showMenuByEmp(roleid);
    }
}
